package com.simple.space.common.exception;

public enum ErrorCode {

    HTTP_STATE_404(404, "请求的资源不存在"),

    INNER(500, "服务器内部异常"),
    GEN_RESP(501, "持久层层代码生成异常"),
    GEN_SERVICE(502, "业务层代码生成异常"),
    GEN_CONTROL(503, "控制层代码生成异常"),

    DB_QUERY(504, "数据库查询记录异常"),
    DB_UPDATE(505, "数据库更新记录异常"),
    DB_INSERT(506, "数据库插入记录异常"),
    DB_DELETE(507, "数据库删除记录异常"),

    PARAM_NULL(600, "参数为空"),
    PARAM_TYPE(601, "参数类型非法"),
    PARAM_LONG(602, "参数超长"),
    PARAM_MISSING(603, "参数缺失"),
    REQUEST_METHOD(604, "请求方式错误"),

    REDIS_SERVER_CONNECT(700, "Redis服务器连接异常"),
    DB_SERVER_CONNECT(701, "数据库连接异常"),

    CACHE_READ(801, "缓存读取异常");



    private Integer code;
    private String message;

    ErrorCode(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }
}
